﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ViewVAReport.aspx.cs" Inherits="admin_Newreport" %>

<%@ Register Assembly="System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
	Namespace="System.Web.DynamicData" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<link href="../styles/admin.css" rel="stylesheet" type="text/css" />
	<title></title>

	<script language="javascript" type="text/javascript">
        function showAlert(value) {

            // document.getElementById('isMultifaults'). = '1';
            if (value == 0) {
                document.getElementById("isMultifaults").value = "1";
                // document.getElementById('isMultifaults').innerText = "wo riririr";
                //form1.elements
                //  alert("goes into javascript:" + document.getElementById("isMultifaults").value);
                document.getElementById('fault2').style.display = 'table-row';
                document.getElementById('fault2con').style.display = 'table-row';
                document.getElementById('fault2rcon').style.display = 'table-row';
            }
            else {
                document.getElementById("isMultifaults").value = "2";
                // document.getElementById('isMultifaults').innerText = "wo riririr";
                //form1.elements
                //  alert("goes into javascript:" + document.getElementById("isMultifaults").value);
                document.getElementById('fault3sev').style.display = 'table-row';
                document.getElementById('fault3con').style.display = 'table-row';
                document.getElementById('fault3reco').style.display = 'table-row';
            }

        }
        function showHint(str) {
            var xmlhttp;
            if (str.length == 0) {
                document.getElementById("Matrix_Textbox").innerHTML = "";
                return;
            }
            if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
                xmlhttp = new XMLHttpRequest();
            }
            else {// code for IE6, IE5
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            xmlhttp.onreadystatechange = function() {
                if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                    document.getElementById("txtHint").innerHTML = xmlhttp.responseText;
                }
            }
            xmlhttp.open("GET", "gethint.asp?q=" + str, true);
            xmlhttp.send();
        }
	</script>

	<script runat="server">
		protected void Check_Change(Object sender, EventArgs e)
		{

			Comment_tb.ReadOnly = CheckBox_oldreport.Checked;

		}
		protected void TextChanged(Object sender, EventArgs e)
		{

			//ErrMsgLabel.Text = "Over the limit";

		}
	</script>

</head>
<body>
	<form id="form1" runat="server">
	<div id="right_content">
		<div class="content_area">
			<h2>
				Create New Report&nbsp;
			</h2>
			<h3>
				<asp:Label ID="Label1" runat="server" Text="Current Component:"></asp:Label>
				&nbsp;
				<asp:Label ID="componentLabel" runat="server" Text="Shaft"></asp:Label>
				&nbsp;
			</h3>
			<div>
				<div class="form_box1">
					<table id="selecttable" runat="server">
						<tr>
							<td class="label">
								Previous Report on :<asp:Label ID="Pre_date" runat="server"></asp:Label>
							</td>
							<td>
								<asp:TextBox ID="PreviousComment" ReadOnly="true" TextMode="MultiLine" runat="server"
									CssClass="fields1" Rows="5"></asp:TextBox>
							</td>
						</tr>
						<tr>
							<td>
							</td>
							<td>
								<asp:CheckBox ID="CheckBox_oldreport" OnCheckedChanged="Check_Change" Text=" Use this report"
									runat="server" CssClass="checkBox" />
							</td>
						</tr>
						<tr style="display: none">
							<td class="label">
								Choose Comment Template:
							</td>
						</tr>
						<tr>
							<td class="label">
								Fault Condition1:
							</td>
							<td>
								<asp:ScriptManager ID="ScriptManager1" runat="server">
								</asp:ScriptManager>
								<asp:UpdatePanel ID="UpdatePanel6" runat="server">
									<ContentTemplate>
										<asp:DropDownList ID="Fault1_DropDownList" AutoPostBack="true" runat="server" OnSelectedIndexChanged="fault1changed"
											CssClass="dropDownList">
										</asp:DropDownList>
									</ContentTemplate>
								</asp:UpdatePanel>
							</td>
						</tr>
						<tr>
							<td class="label">
								Fault1 Severity:
							</td>
							<td>
								<asp:UpdatePanel ID="UpdatePanel_severity" runat="server">
									<ContentTemplate>
										<asp:DropDownList ID="Severity_DropDownList" runat="server" AutoPostBack="true" OnSelectedIndexChanged="severityChanged"
											CssClass="dropDownList">
											<asp:ListItem Text="NORMAL" Value="1"></asp:ListItem>
											<asp:ListItem Text="ABNORMAL" Value="2"></asp:ListItem>
											<asp:ListItem Text="MODERATE" Value="3"></asp:ListItem>
											<asp:ListItem Text="SEVERE" Value="4"></asp:ListItem>
											<asp:ListItem Text="NOT TESTED" Value="5"></asp:ListItem>
										</asp:DropDownList>
									</ContentTemplate>
									<Triggers>
										<asp:AsyncPostBackTrigger ControlID="Fault1_DropDownList" />
									</Triggers>
								</asp:UpdatePanel>
							</td>
						</tr>
						<tr>
							<td class="label">
								Recommendation1:
							</td>
							<td>
								<asp:UpdatePanel ID="UpdatePanel_reco" runat="server">
									<ContentTemplate>
										<asp:DropDownList ID="Reco_DropDownList" runat="server" CssClass="dropDownList">
										</asp:DropDownList>
									</ContentTemplate>
									<Triggers>
										<asp:AsyncPostBackTrigger ControlID="Fault1_DropDownList" />
										<asp:AsyncPostBackTrigger ControlID="Severity_DropDownList" />
									</Triggers>
								</asp:UpdatePanel>
							</td>
						</tr>
						<tr id="fault2" style="display: none">
							<td bgcolor="#33CCCC" class="label">
								<asp:Label ID="Label2" runat="server"> Fault2 Condition</asp:Label>
							</td>
							<td>
								<asp:DropDownList ID="Fault1_DropDownList0" AutoPostBack="true" runat="server" OnSelectedIndexChanged="fault2changed"
									CssClass="dropDownList">
								</asp:DropDownList>
							</td>
						</tr>
						<tr id="fault2con" style="display: none">
							<td bgcolor="#33CCCC" class="label">
								<asp:Label runat="server" ID="Label4"> Fault2 Severity</asp:Label>
							</td>
							<td>
								<asp:UpdatePanel ID="UpdatePanel1" runat="server">
									<ContentTemplate>
										<asp:DropDownList ID="Severity_DropDownList0" runat="server" AutoPostBack="true"
											OnSelectedIndexChanged="severityChanged0" CssClass="dropDownList">
											<asp:ListItem Text="NORMAL" Value="1"></asp:ListItem>
											<asp:ListItem Text="ABNORMAL" Value="2"></asp:ListItem>
											<asp:ListItem Text="MODERATE" Value="3"></asp:ListItem>
											<asp:ListItem Text="SEVERE" Value="4"></asp:ListItem>
											<asp:ListItem Text="NOT TESTED" Value="5"></asp:ListItem>
										</asp:DropDownList>
									</ContentTemplate>
									<Triggers>
										<asp:AsyncPostBackTrigger ControlID="Fault1_DropDownList0" />
									</Triggers>
								</asp:UpdatePanel>
							</td>
						</tr>
						<tr id="fault2rcon" style="display: none">
							<td bgcolor="#33CCCC" class="label">
								<asp:Label ID="Label3" runat="server"> Fault2 Recommendation</asp:Label>
							</td>
							<td>
								<asp:UpdatePanel ID="UpdatePanel3" runat="server">
									<ContentTemplate>
										<asp:DropDownList ID="Reco_DropDownList0" runat="server" CssClass="dropDownList">
										</asp:DropDownList>
									</ContentTemplate>
									<Triggers>
										<asp:AsyncPostBackTrigger ControlID="Fault1_DropDownList0" />
										<asp:AsyncPostBackTrigger ControlID="Severity_DropDownList0" />
									</Triggers>
								</asp:UpdatePanel>
							</td>
						</tr>
						<tr id="fault3con" style="display: none">
							<td bgcolor="#333300" class="label">
								<asp:Label ID="Label5" runat="server"> Fault3 Condition</asp:Label>
							</td>
							<td>
								<asp:DropDownList ID="Fault3_DropDownList" AutoPostBack="true" runat="server" OnSelectedIndexChanged="fault3changed"
									CssClass="dropDownList">
								</asp:DropDownList>
							</td>
						</tr>
						<tr id="fault3sev" style="display: none">
							<td bgcolor="#33CCCC" class="label">
								<asp:Label runat="server" ID="Label6"> Fault3 Severity</asp:Label>
							</td>
							<td>
								<asp:UpdatePanel ID="UpdatePanel4" runat="server">
									<ContentTemplate>
										<asp:DropDownList ID="Severity3_DropDownList" runat="server" AutoPostBack="true"
											OnSelectedIndexChanged="severity3Changed" CssClass="dropDownList">
											<asp:ListItem Text="NORMAL" Value="1"></asp:ListItem>
											<asp:ListItem Text="ABNORMAL" Value="2"></asp:ListItem>
											<asp:ListItem Text="MODERATE" Value="3"></asp:ListItem>
											<asp:ListItem Text="SEVERE" Value="4"></asp:ListItem>
											<asp:ListItem Text="NOT TESTED" Value="5"></asp:ListItem>
										</asp:DropDownList>
									</ContentTemplate>
									<Triggers>
										<asp:AsyncPostBackTrigger ControlID="Severity3_DropDownList" />
									</Triggers>
								</asp:UpdatePanel>
							</td>
						</tr>
						<tr id="fault3reco" style="display: none">
							<td bgcolor="#33CCCC" class="label">
								<asp:Label ID="Label7" runat="server"> Fault3 Recommendation</asp:Label>
							</td>
							<td>
								<asp:UpdatePanel ID="UpdatePanel5" runat="server">
									<ContentTemplate>
										<asp:DropDownList ID="Reco3_DropDownList" runat="server" CssClass="dropDownList">
										</asp:DropDownList>
									</ContentTemplate>
									<Triggers>
										<asp:AsyncPostBackTrigger ControlID="Fault3_DropDownList" />
										<asp:AsyncPostBackTrigger ControlID="Severity3_DropDownList" />
									</Triggers>
								</asp:UpdatePanel>
							</td>
						</tr>
						<tr>
							<td>
								<input type="button" value="AddFaultButton" onclick="showAlert(isMultifaults.value)"
									class="buttons" />
							</td>
							<td style="display: none">
								<asp:TextBox ID="isMultifaults" runat="server" Text="0" CssClass="fields1" />
							</td>
						</tr>
						<tr>
							<td class="label">
								Resurvey Frequency:
							</td>
							<td>
								<asp:DropDownList ID="Resurvey_DropDownList" runat="server" CssClass="dropDownList">
								</asp:DropDownList>
							</td>
						</tr>
						<tr>
							<td>
								<asp:Button ID="Generate_Button" runat="server" Text="PreviewReport" OnClick="Generate_Button_Click"
									CssClass="buttons" />
							</td>
							<td>
								<asp:UpdatePanel ID="UpdatePanel2" runat="server">
									<ContentTemplate>
										<asp:TextBox ID="Comment_tb" runat="server" TextMode="MultiLine" Text="Show the report here"
											CssClass="fields1" MaxLength="1000" Rows="5" />
									</ContentTemplate>
									<Triggers>
										<asp:AsyncPostBackTrigger ControlID="Template_DropDownList" />
										<asp:AsyncPostBackTrigger ControlID="Generate_Button" />
									</Triggers>
								</asp:UpdatePanel>
							</td>
						</tr>
						<tr>
							<td class="label">
								<asp:Label runat="server" ID="matrix_label" Visible="true" Font-Bold="true" Font-Size="Medium"
									ForeColor="Red">Matrix</asp:Label>
							</td>
							<td>
								<asp:DropDownList ID="DropDownList_Matrix" runat="server" CssClass="dropDownList">
									<asp:ListItem Text="NORMAL(0-75)" Value="1">
									</asp:ListItem>
									<asp:ListItem Text="ABNORMAL(75-100)" Value="2">
									</asp:ListItem>
									<asp:ListItem Text="MODERATE(100-125)" Value="3">
									</asp:ListItem>
									<asp:ListItem Text="SEVERE(125-150)" Value="4">
									</asp:ListItem>
									<asp:ListItem Text="NOT TESTED(0-150)" Value="5">
									</asp:ListItem>
								</asp:DropDownList>
								<asp:TextBox ID="Matrix_Textbox" runat="server" CssClass="fields">75</asp:TextBox>
								<asp:CustomValidator ID="MatrixValidator" runat="server" ValidationGroup="reportgroup"
									OnServerValidate="ServerValidate" ControlToValidate="Matrix_Textbox" ErrorMessage="Err Input"></asp:CustomValidator>
							</td>
						</tr>
						<tr>
							<td>
								<asp:Button ID="submit_button" runat="server" Text="Update" ValidationGroup="reportgroup"
									OnClick="submit_button_Click" CssClass="buttons" />
							</td>
							<td>
								<a href="EmailNotification.aspx" target="_parent">EMAIL NOTIFICATION</a>
							</td>
						</tr>
					</table>
				</div>
				<asp:HyperLink ID="HyperLink1" runat="server" Target="_parent" NavigateUrl="~/admin/Create_Report.aspx"
					CssClass="backbtn">Return</asp:HyperLink>
			</div>
		</div>
	</div>
	</form>
</body>
</html>
